﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Data;
using System.Web.UI.WebControls;
using weikebuluo.Model;
using weikebuluo.DAL;
using weikebuluo.Common;
using weikeweixin.web.wechat.api.cs;
using System.Collections.Specialized;

namespace weikebuluo.web.admin.postmessage
{
    public partial class posttext : weikeweixin.web.admin.cs.adminbase
    {
        common apicommon = new common();
        JsonOperate JsonOperate = new JsonOperate();
        protected string json = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            json = apicommon.grouplist(wechat_id);
            switch (Request.Form["action"]) { 
                case "posttext":
                    ptext();
                    break;
            }
        }

        #region 发送文本
        /// <summary>
        /// 发送文本
        /// </summary>
        /// <returns></returns>
        public void ptext()
        {
            string result = apicommon.postexttmessage(wechat_id, Request.Form["ptext"], Request.Form["groupid"]);
            Response.Write("{\"errno\":\"" + result + "\",\"tip\":\"发送成功！\",\"url\":\"posttext.aspx\",\"error\":\"发送失败:" + result + "\"}");
            Response.End();
        }
        #endregion 发送文本
    }
}